﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminFullAccess.aspx.cs" Inherits="DelonixRegiaHotel.AdminFullAccess" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 1270px;
            height: 702px;
        }
        .auto-style3 {
            height: 60px;
        }
        .auto-style4 {
            height: 52px;
        }
        .auto-style6 {
            height: 181px;
        }
        .auto-style7 {
            width: 1270px;
        }
        </style>
</head>
<body style='background: #000'>
    <form id="form1" runat="server">
    <div>
    
        <table cellspacing="0" class="auto-style1" style="background-image:url(Images/TemplateForHome.png); background-size: cover;">
            <tr>
            <td class="auto-style3" colspan="9">
                <asp:ImageButton ID="btnLogo" runat="server" CausesValidation="False" ImageUrl="~/Images/Delonix Regia Logo.png" OnClick="btnLogo_Click" />
            </td>
            <td class="auto-style3">
                <asp:ImageButton ID="btnLogout" runat="server" CausesValidation="False" ImageUrl="~/Images/Logout.png" OnClick="btnLogout_Click" />
            </td>
        </tr>
        <tr>
            <td class="auto-style4">&nbsp;&nbsp;&nbsp;</td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnAdmin" runat="server" CausesValidation="False" ImageUrl="~/Images/Admin.png" OnClick="btnAdmin_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnCheckIn" runat="server" CausesValidation="False" ImageUrl="~/Images/Check-In.png" OnClick="btnCheckIn_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnCheckOut" runat="server" CausesValidation="False" ImageUrl="~/Images/Check-Out.png" OnClick="btnCheckOut_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnQuery" runat="server" CausesValidation="False" ImageUrl="~/Images/Query.png" OnClick="btnQuery_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnBooking" runat="server" CausesValidation="False" ImageUrl="~/Images/Booking.png" OnClick="btnBooking_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnRates" runat="server" CausesValidation="False" ImageUrl="~/Images/Rates.png" OnClick="btnRates_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnStaff" runat="server" CausesValidation="False" ImageUrl="~/Images/Staff.png" OnClick="btnStaff_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnReport" runat="server" CausesValidation="False" ImageUrl="~/Images/Report.png" OnClick="btnReport_Click" />
            </td>
            <td class="auto-style4"></td>
        </tr>
        <tr>
            <td class="auto-style6" colspan="10">
                &nbsp;&nbsp;
                &nbsp; 
                &nbsp; 
                &nbsp; 
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="username" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="Yellow">
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
                        <asp:BoundField DataField="username" HeaderText="username" ReadOnly="True" SortExpression="username" />
                        <asp:BoundField DataField="password" HeaderText="password" SortExpression="password" />
                        <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                        <asp:BoundField DataField="date_of_birth" HeaderText="date_of_birth" SortExpression="date_of_birth" />
                        <asp:BoundField DataField="bank_account_number" HeaderText="bank_account_number" SortExpression="bank_account_number" />
                        <asp:BoundField DataField="home_address" HeaderText="home_address" SortExpression="home_address" />
                        <asp:BoundField DataField="tel_num" HeaderText="tel_num" SortExpression="tel_num" />
                        <asp:BoundField DataField="rank" HeaderText="rank" SortExpression="rank" />
                    </Columns>
                    <SelectedRowStyle BorderColor="Red" BorderWidth="2px" ForeColor="Red" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hoteldbConnectionString %>" DeleteCommand="DELETE FROM [HotelUser] WHERE [username] = @username" InsertCommand="INSERT INTO [HotelUser] ([username], [password], [name], [date_of_birth], [bank_account_number], [home_address], [tel_num], [rank]) VALUES (@username, @password, @name, @date_of_birth, @bank_account_number, @home_address, @tel_num, @rank)" ProviderName="<%$ ConnectionStrings:hoteldbConnectionString.ProviderName %>" SelectCommand="SELECT [username], [password], [name], [date_of_birth], [bank_account_number], [home_address], [tel_num], [rank] FROM [HotelUser]" UpdateCommand="UPDATE [HotelUser] SET [password] = @password, [name] = @name, [date_of_birth] = @date_of_birth, [bank_account_number] = @bank_account_number, [home_address] = @home_address, [tel_num] = @tel_num, [rank] = @rank WHERE [username] = @username">
                    <DeleteParameters>
                        <asp:Parameter Name="username" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="username" Type="String" />
                        <asp:Parameter Name="password" Type="String" />
                        <asp:Parameter Name="name" Type="String" />
                        <asp:Parameter Name="date_of_birth" Type="String" />
                        <asp:Parameter Name="bank_account_number" Type="String" />
                        <asp:Parameter Name="home_address" Type="String" />
                        <asp:Parameter Name="tel_num" Type="String" />
                        <asp:Parameter Name="rank" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="password" Type="String" />
                        <asp:Parameter Name="name" Type="String" />
                        <asp:Parameter Name="date_of_birth" Type="String" />
                        <asp:Parameter Name="bank_account_number" Type="String" />
                        <asp:Parameter Name="home_address" Type="String" />
                        <asp:Parameter Name="tel_num" Type="String" />
                        <asp:Parameter Name="rank" Type="String" />
                        <asp:Parameter Name="username" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="username" DataSourceID="SqlDataSource1" ForeColor="Yellow" Height="50px" Width="1137px">
                    <Fields>
                        <asp:BoundField DataField="username" HeaderText="username" ReadOnly="True" SortExpression="username" />
                        <asp:BoundField DataField="password" HeaderText="password" SortExpression="password" />
                        <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                        <asp:BoundField DataField="date_of_birth" HeaderText="date_of_birth" SortExpression="date_of_birth" />
                        <asp:BoundField DataField="bank_account_number" HeaderText="bank_account_number" SortExpression="bank_account_number" />
                        <asp:BoundField DataField="home_address" HeaderText="home_address" SortExpression="home_address" />
                        <asp:BoundField DataField="tel_num" HeaderText="tel_num" SortExpression="tel_num" />
                        <asp:BoundField DataField="rank" HeaderText="rank" SortExpression="rank" />
                        <asp:CommandField ShowInsertButton="True" />
                    </Fields>
                </asp:DetailsView>
            </td>
        </tr>
        <tr>
            <td class="auto-style7" colspan="10">&nbsp;</td>
        </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
